<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="__JS__/qtip/js/jquery.qtip.min.js"></script>
<link href="__JS__/qtip/css/jquery.qtip.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="__JS__/validfrom/css/style.css" type="text/css" media="all" />
<script type="text/javascript" src="__JS__/NiceForms/niceforms.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="__JS__/NiceForms/niceforms-default.css" />
<link href="__CSS__/main.css" rel="stylesheet" type="text/css" />
<literal>
<script>
$(document).ready(function(){

	
	
	$("#submitImage").bind("click",function(){
		$('#orderForm').ajaxSubmit(options); 
	});
	
	var options={
			 beforeSubmit:  showRequest,  
			 success:       showResponse  
	};
	function showRequest(formData, jqForm, options) {  
		
		if($("#U_NAME").val()==""){
			$("#Validform_checktip_U_NAME").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入会员名</a>");
			return false;
		}else{
			$("#Validform_checktip_U_NAME").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		if($("#U_RNAME").val()==""){
			$("#Validform_checktip_U_RNAME").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入姓名</a>");
			return false;
		}else{
			$("#Validform_checktip_U_RNAME").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		if($("#U_PWD").val()==""){
			$("#Validform_checktip_U_PWD").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入密码</a>");
			return false;
		}else{
			$("#Validform_checktip_U_PWD").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		if($("#U_PWD1").val()==""){
			$("#Validform_checktip_U_PWD1").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入确认密码</a>");
			return false;
		}else{
			$("#Validform_checktip_U_PWD1").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		if($("#U_PWD1").val()!=$("#U_PWD").val()){
			$("#Validform_checktip_U_PWD1").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>密码与确认密码不一致</a>");
			return false;
		}else{
			$("#Validform_checktip_U_PWD1").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		
		if($("#U_EMAIL").val()==""){
			$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入邮箱</a>");
			return false;
		}else{
			var _re=/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
			
			if(!_re.test($("#U_EMAIL").val())){
				$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>邮箱格式错误</a>");
				return false;
			}else{
				$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
			}
		}
		if($("#U_MOBILE").val()==""){
			$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>请输入手机</a>");
			return false;
		}else{
			var _re=/^\d{11}$/;
			if(!_re.test($("#U_MOBILE").val())){
				$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>手机格式错误</a>");
				return false;
			}else{
				$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
			}
		}
		
		 return true;
	}
	
	function showResponse(rs, statusText, xhr, $form)  { 
		if(rs=="member"){
			$("#Validform_checktip_U_NAME").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>会员名重复</a>");
			return false;
		}else{
			$("#Validform_checktip_U_NAME").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		
		if(rs=="E"){
			$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>邮箱重复</a>");
			return false;
		}else{
			$("#Validform_checktip_U_EMAIL").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		if(rs=="M"){
			$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/error.png' /><font color='red'>手机重复</a>");
			return false;
		}else{
			$("#Validform_checktip_U_MOBILE").html("<img src='__PUBLIC__/js/validfrom/images/right.png' />");
		}
		
		if(rs=='n'){
			userTip('submitImage','修改信息失败！');
			/*info="修改信息失败！";
			type='2';
			url="?g=Home&m=Member&a=uinfo";
			*/
			return false;
		}
		
		info="信息提交成功！";
		type='1';
		url="?g=Home&m=Member&a=wlist";
		window.location.href="?g=Home&m=Index&a=info&type="+type+"&info="+encodeURI(info)+"&url="+encodeURIComponent(url);
		
	} 
	
	
});
function userTip(sob,ct){
	 // 阴影+圆角
     $("#"+sob).qtip({
   	 	position: {
            my: 'bottom left',
            at: 'top center'
       },
       style: {
         classes: 'ui-tooltip-light ui-tooltip-shadow ui-tooltip-rounded'
       },
       show: {
			event: 'click', // Don't specify a show event...
			ready: true // ... but show the tooltip when ready
		},
       content: {
    	   text:ct,
    	   title:{
    	    	  text:"提示信息", 
    	    	  button:"关闭"
    	       }
       },
       hide:false
       
     });
}



</script>
</literal>
<style>

.content{
	background-color:#F9F9F9;
	width:750px;
	height:440px;
	margin-left:95px;
}
</style>
<div id="container">
<div class="content" style="height:400px;margin-left: 0;">
<form action="{$action}" method="post" id="orderForm" class="niceform">
	<div style="padding-top:20px;">
		<table border=0 cellspacing=0 cellpadding=0 width="100%">
			<tr>
				
				<td colspan="3" align="left" valign="bottom">
				<div style="padding-left:20px;height:20px;color:#FF7625;font-weight:bold;font-size:15px;">安装人员信息
				
				</div>
				
				</td>
			</tr>
			<tr>
			<td colspan="3" valign="top">
				<div style="height:2px;width:150px;background-color:#FF7625;margin-left:20px;"></div>
				</td>
			</tr>
			<tr>
				<td width="120px">
					
				</td>
				<td  align="left">
					<div style="">
					<table border="0" >
						 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;" ><span class="inputYes">*</span>会员名</td>
		                    <td style=""><input type="text" id="U_NAME" name="data[U_NAME]" class="inputxt" value="{$userInfo.U_NAME}" datatype="*" nullmsg="请输入姓名！"  /></td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_NAME">请输入会员名</div></td>
		                </tr>
		                <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;" ><span class="inputYes">*</span>姓名</td>
		                    <td style=""><input type="text" id="U_RNAME" name="data[U_RNAME]" class="inputxt" value="{$userInfo.U_RNAME}" datatype="*" nullmsg="请输入姓名！"  /></td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_RNAME">请输入姓名</div></td>
		                </tr>
		                <if condition="$edit neq 'y'">
		                 <tr>
		                    <td class="need" style="width:10px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>密码：</td>
		                    <td style="width:205px;"><input type="password" id="U_PWD" name="data[U_PWD]" class="inputxt" datatype="*6-16" nullmsg="请设置密码！" errormsg="密码范围在6~16位之间！" /></td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_PWD"></div></td>
		                </tr>
		                <tr>
		                    <td class="need"  style="width:10px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>确认密码：</td>
		                    <td><input type="password" id="U_PWD1" name="data[U_PWD1]" class="inputxt" datatype="*" recheck="data[U_PWD]" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！" /></td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_PWD1"></div></td>
		                </tr>
		                </if>
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>邮箱</td>
		                    <td style=""><input type="text" id="U_EMAIL" name="data[U_EMAIL]" class="inputxt" value="{$userInfo.U_EMAIL}" datatype="*" nullmsg="请输入邮箱！"  />
		                     <input type="hidden" id="OLD_U_EMAIL" name="data[OLD_U_EMAIL]" value="{$userInfo.U_EMAIL}"  />
		                    </td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_EMAIL">请输入邮箱</div></td>
		                </tr>
		                
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;"><span class="inputYes">*</span>手机</td>
		                    <td style="width:;"><input type="text" onkeyup="this.value=this.value.replace(/\D/g,'');" id="U_MOBILE" name="data[U_MOBILE]" value="{$userInfo.U_MOBILE}" class="inputxt" datatype="*" nullmsg="请输入手机！"  />
		                     <input type="hidden" id="OLD_U_MOBILE" name="data[OLD_U_MOBILE]" value="{$userInfo.U_MOBILE}"  />
		                    </td>
		                    <td><div class="Validform_checktip" id="Validform_checktip_U_MOBILE">请输入手机</div></td>
		                </tr>
		                 <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:80px;line-height:30px;">固定电话</td>
		                    <td style="width:;"><input type="text" id="U_PHONE" name="data[U_PHONE]" value="{$userInfo.U_PHONE}" class="inputxt" nullmsg="请输入固定电话！"  /></td>
		                    <td><div class="Validform_checktip">请输入固定电话</div></td>
		                </tr>
		                <tr>
		                    <td class="need" style="width:0px;"></td>
		                    <td style="width:0px;"></td>
		                    <td style="width:205px;" valign="bottom" align="center">
		                   	<br />
		                    	<input type="hidden" name="u_id" value="{$uid}">
		                    	<input type="hidden" name="st_id" value="{$st_id}">
    							<input type="hidden" name="op" value="1">
    							<div style="display:none"><input type="submit" id="sumit" name="sumit" ></div>
		                    	<img src="__PUBLIC__/images/home/bg-ok-button.png" id="submitImage" align="absmiddle" style="cursor:pointer">
		                    </td>
		                    <td></td>
		                </tr>
		                    
					
					</table>
					</div>
				</td>
			</tr>
			
		</table>
	</div>
	</form>
</div>
</div>
